home *** CD-ROM | disk | FTP | other *** search
- @echo off
-
- echo ┌──────────────────────────────────────────────────────────┐
- echo │ This batch file optimizes your calendarfile by exporting │
- echo │ everything from the file and then importing it again. │
- echo └──────────────────────────────────────────────────────────┘
- echo.
- set calfilename=%1
- if not "%1"=="" goto continue
- set calfilename=default.cal
-
- echo ┌──────────────────────────────────────────────────────────┐
- echo │No option is specified! │
- echo │default.cal is assumed. │
- echo │ │
- echo │To select another file use: │
- echo │optimize [filename] │
- echo └──────────────────────────────────────────────────────────┘
- echo.
-
- :continue
- echo.┌──────────────────────────────────────────────────────────┐
- echo │Press any key to continue or │
- echo │press ctrl-c to stop now! │
- echo └──────────────────────────────────────────────────────────┘
- echo.
- pause > nul
-
- if not exist %calfilename% goto nofile
-
- if exist *.dac goto dacs_found
-
- calport -f %calfilename% -e *
- if not exist *.dac goto export_error
- del %calfilename%
-
- calport -f %calfilename% -i week*.dac
- del week*.dac
- calport -f %calfilename% -i month*.dac
- del month*.dac
- calport -f %calfilename% -i year*.dac
- del year*.dac
- calport -f %calfilename% -i t*.dac
- del t*.dac
-
- rem This is for support for future version of cal
- calport -f %calfilename% -i *.dac
- del *.dac
-
- goto end
-
- :nofile
- echo Can't find %calfilename%
- goto end
-
- :dacs_found
- echo There are .dac files in the directory already
- goto end
-
- :export_error
- echo Error exporting .dac files
- goto end
- :end
- set calfilename=
-